package com.mostromas.ess.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mostromas.ess.entities.SysMenu;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysMenuMapper extends BaseMapper<SysMenu> {
    /**
     * 根据用户ID获取拥有资源权限
     * @param userId    用户ID
     * @return
     */
    List<SysMenu> selectMenuByUserId(@Param("userId")String userId);

    List<SysMenu> findMenuByRoleId(@Param("roleId")String roleId);

    /**
     * 删除角色菜单中间表
     * @param menuId
     * @return
     */
    boolean deleteRoleMenuByMenuId(@Param("menuId") String menuId);
}
